﻿using System;
using System.Collections.Generic;
using System.ServiceModel;
using System.ServiceModel.Channels;
using System.ServiceModel.Description;

namespace Nx.Services
{
    public interface IHostService : IDisposable
    {
        void AddService<TService>(ServiceEndpoint endpoint, Uri baseAddress);
        void AddService<TContract, TService>(Binding binding, Uri baseAddress) where TService : TContract;
        void AddService<TService>(IEnumerable<ServiceEndpoint> endpoints, Uri baseAddress);
        void AddService<TService>(TService singletonInstance, ServiceEndpoint endpoint, Uri baseAddress);
        void AddService<TService>(TService singletonInstance, IEnumerable<ServiceEndpoint> endpoints, Uri baseAddress);
        void RemoveService<TService>(Uri baseAddress);
        void RemoveService<TService>(TService singletonInstance);

        CommunicationState GetServiceState<TService>(Uri baseAddress);
        CommunicationState GetServiceState<TService>(TService singletonInstance);

        event EventHandler ServiceHostFaulted;
    }
}
